<?php
/**
 * 文章管理
 * @author Kevin_ren  <330202207@qq.com>
 */

namespace Admin\Controller;

use Common\Controller\BaseManageController;

class ArticleController extends BaseManageController
{

    /**
     * 文章列表
     * @author Kevin_ren  <330202207@qq.com>
     */
    public function index()
    {
        $Model = D("Article");

        $data = $this->lists($Model);

        foreach ($data as $k => $val) {
            $data[$k] = $Model->_format($val);
        }

        $this->assign('list', $data);
        $this->display();
    }


    /**
     * 添加前置操作
     * @author Kevin_ren  <330202207@qq.com>
     */
    public function  _before_add()
    {
        $category = D("Category")->getAllData();
        $this->assign("category", $category);
    }

    /**
     * 编辑前置操作
     * @author Kevin_ren  <330202207@qq.com>
     */
    public function _before_edit()
    {
        $this->_before_add();
    }

} 